package com.sky.mapper;

import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrderDetailMapper {

    //保存订单明细
    @Insert("insert into order_detail values (null,#{name},#{image},#{orderId},#{dishId},#{setmealId},#{dishFlavor},#{number},#{amount})")
    void save(OrderDetail orderDetail);

    // 根据订单id查询明细
    @Select("select * from order_detail where order_id = #{orderId}")
    List<OrderDetail> findByOrderId(Long orderId);
}
